home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / info.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  6.1 KB  |  150 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) info.n 1.3 94/12/17 16:18:12
  9. '\" 
  10. .so man.macros
  11. .HS info tcl 7.0
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. info \- Return information about the state of the Tcl interpreter
  16. .SH SYNOPSIS
  17. \fBinfo \fIoption \fR?\fIarg arg ...\fR?
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. This command provides information about various internals of the Tcl
  23. interpreter.
  24. The legal \fIoption\fR's (which may be abbreviated) are:
  25. .TP
  26. \fBinfo args \fIprocname\fR
  27. Returns a list containing the names of the arguments to procedure
  28. \fIprocname\fR, in order.  \fIProcname\fR must be the name of a
  29. Tcl command procedure.
  30. .TP
  31. \fBinfo body \fIprocname\fR
  32. Returns the body of procedure \fIprocname\fR.  \fIProcname\fR must be
  33. the name of a Tcl command procedure.
  34. .TP
  35. \fBinfo cmdcount\fR
  36. Returns a count of the total number of commands that have been invoked
  37. in this interpreter.
  38. .TP
  39. \fBinfo commands \fR?\fIpattern\fR?
  40. If \fIpattern\fR isn't specified, returns a list of names of all the
  41. Tcl commands, including both the built-in commands written in C and
  42. the command procedures defined using the \fBproc\fR command.
  43. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  44. are returned.  Matching is determined using the same rules as for
  45. \fBstring match\fR.
  46. .TP
  47. \fBinfo complete \fIcommand\fR
  48. Returns 1 if \fIcommand\fR is a complete Tcl command in the sense of
  49. having no unclosed quotes, braces, brackets or array element names,
  50. If the command doesn't appear to be complete then 0 is returned.
  51. This command is typically used in line-oriented input environments
  52. to allow users to type in commands that span multiple lines;  if the
  53. command isn't complete, the script can delay evaluating it until additional
  54. lines have been typed to complete the command.
  55. .TP
  56. \fBinfo default \fIprocname arg varname\fR
  57. \fIProcname\fR must be the name of a Tcl command procedure and \fIarg\fR
  58. must be the name of an argument to that procedure.  If \fIarg\fR
  59. doesn't have a default value then the command returns \fB0\fR.
  60. Otherwise it returns \fB1\fR and places the default value of \fIarg\fR
  61. into variable \fIvarname\fR.
  62. .TP
  63. \fBinfo exists \fIvarName\fR
  64. Returns \fB1\fR if the variable named \fIvarName\fR exists in the
  65. current context (either as a global or local variable), returns \fB0\fR
  66. otherwise.
  67. .TP
  68. \fBinfo globals \fR?\fIpattern\fR?
  69. If \fIpattern\fR isn't specified, returns a list of all the names
  70. of currently-defined global variables.
  71. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  72. are returned.  Matching is determined using the same rules as for
  73. \fBstring match\fR.
  74. .TP
  75. \fBinfo level\fR ?\fInumber\fR?
  76. If \fInumber\fR is not specified, this command returns a number
  77. giving the stack level of the invoking procedure, or 0 if the
  78. command is invoked at top-level.  If \fInumber\fR is specified,
  79. then the result is a list consisting of the name and arguments for the
  80. procedure call at level \fInumber\fR on the stack.  If \fInumber\fR
  81. is positive then it selects a particular stack level (1 refers
  82. to the top-most active procedure, 2 to the procedure it called, and
  83. so on); otherwise it gives a level relative to the current level
  84. (0 refers to the current procedure, -1 to its caller, and so on).
  85. See the \fBuplevel\fR command for more information on what stack
  86. levels mean.
  87. .TP
  88. \fBinfo library\fR
  89. Returns the name of the library directory in which standard Tcl
  90. scripts are stored.
  91. The default value for the library is compiled into Tcl, but it
  92. may be overridden by setting the TCL_LIBRARY environment variable.
  93. If there is no TCL_LIBRARY variable and no compiled-in value then
  94. and error is generated.
  95. See the \fBlibrary\fR manual entry for details of the facilities
  96. provided by the Tcl script library.
  97. Normally each application will have its own application-specific
  98. script library in addition to the Tcl script library;  I suggest that
  99. each application set a global variable with a name like
  100. \fB$\fIapp\fB_library\fR (where \fIapp\fR is the application's name)
  101. to hold the location of that application's library directory.
  102. .TP
  103. \fBinfo locals \fR?\fIpattern\fR?
  104. If \fIpattern\fR isn't specified, returns a list of all the names
  105. of currently-defined local variables, including arguments to the
  106. current procedure, if any.
  107. Variables defined with the \fBglobal\fR and \fBupvar\fR commands
  108. will not be returned.
  109. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  110. are returned.  Matching is determined using the same rules as for
  111. \fBstring match\fR.
  112. .TP
  113. \fBinfo patchlevel\fR
  114. .VS
  115. Returns a decimal integer giving the current patch level for Tcl.
  116. The patch level is incremented for each new release or patch, and
  117. it uniquely identifies an official version of Tcl.
  118. .VE
  119. .TP
  120. \fBinfo procs \fR?\fIpattern\fR?
  121. If \fIpattern\fR isn't specified, returns a list of all the
  122. names of Tcl command procedures.
  123. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  124. are returned.  Matching is determined using the same rules as for
  125. \fBstring match\fR.
  126. .TP
  127. \fBinfo script\fR
  128. If a Tcl script file is currently being evaluated (i.e. there is a
  129. call to \fBTcl_EvalFile\fR active or there is an active invocation
  130. of the \fBsource\fR command), then this command returns the name
  131. of the innermost file being processed.  Otherwise the command returns an
  132. empty string.
  133. .TP
  134. \fBinfo tclversion\fR
  135. Returns the version number for this version of Tcl in the form \fIx.y\fR,
  136. where changes to \fIx\fR represent major changes with probable
  137. incompatibilities and changes to \fIy\fR represent small enhancements and
  138. bug fixes that retain backward compatibility.
  139. .TP
  140. \fBinfo vars\fR ?\fIpattern\fR?
  141. If \fIpattern\fR isn't specified,
  142. returns a list of all the names of currently-visible variables, including
  143. both locals and currently-visible globals.
  144. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  145. are returned.  Matching is determined using the same rules as for
  146. \fBstring match\fR.
  147.  
  148. .SH KEYWORDS
  149. command, information, interpreter, level, procedure, variable
  150.